package com.cdwm.mrp.common.tools;


import lombok.Data;

/**
 * @version v1.0
 * @Author: lyw
 * @Date: 2021/8/3
 */
@Data
public class LayuiResponse<T> {
    private static final  Integer CODE = 0;
    private  static final  String MSG = "";


    private Integer code;

    private String msg;

    private Long count;

    private T data;

    public static  <T> LayuiResponse<T> ok(T data, Long count) {
        return result(data,count);
    }


    private static <T>  LayuiResponse<T> result(T data, Long count) {
        LayuiResponse<T> layuiResponse = new LayuiResponse<>();
        layuiResponse.setData(data);
        layuiResponse.setCode(CODE);
        layuiResponse.setMsg(MSG);
        layuiResponse.setCount(count);
        return layuiResponse;
    }

}
